package face.pay.entity;

import java.util.UUID;

/**
 * @Auther: zkj
 * @Date: 2019/8/21 18:32
 * @Description:文件信息
 */
public class FileInfo {

    private Long id;

    private Integer oemId;

    /**
     * 文件所有者
     */
    private Integer userId;


    /**
     * 原始文件目录
     */
    private String fileName;

    /**
     * oss 存储路径
     */
    private String fullName;

    private String url;

    /**
     * 媒体文件ID
     */
    private String mediaId;

    private String  createdTime;

    private Integer createdBy;

    private String  updatedTime;

    private Integer updatedBy;

    /**
     * 只用作接收参数 文件二进制字符串
     */
    private String body;

    public FileInfo() {

    }

    public FileInfo(Integer oemId, Integer userId, String fileName, String fullName) {
        this.oemId = oemId;
        this.userId = userId;
        this.fileName = fileName;
        this.fullName = fullName;
    }

    public String createFullName(Integer oemId){
        String fullName = String.valueOf(oemId)+"/"+this.userId+"/"
                +UUID.randomUUID().toString()+"_"+this.fileName;
         this.setFullName(fullName);
        return fullName;
    }

    public String createAdvertFullName(Integer oemId){
        String fullName = String.valueOf(oemId)+"/"+this.userId+"/advert/"
                +UUID.randomUUID().toString()+"_"+this.fileName;
        this.setFullName(fullName);
        return fullName;
    }

    public String createStoreFullName(Integer oemId){
        String fullName = String.valueOf(oemId)+"/"+this.userId+"/store/"
                +UUID.randomUUID().toString()+"_"+this.fileName;
        this.setFullName(fullName);
        return fullName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public Integer getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

    public String getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(String updatedTime) {
        this.updatedTime = updatedTime;
    }

    public Integer getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(Integer updatedBy) {
        this.updatedBy = updatedBy;
    }

    public Integer getOemId() {
        return oemId;
    }

    public void setOemId(Integer oemId) {
        this.oemId = oemId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }
}
